﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using QuanLyThuVien.DTO;
using System.Data.Linq;


namespace QuanLyThuVien.DAO
{
    class LapTheDocGiaDAO
    {

        public static Table<DocGia> DSDG()
        {
            QLTVclassDataContext QLTV = new QLTVclassDataContext();
            return QLTV.DocGias;
        }
        //public static void LapTheDG(LapTheDocGiaDTO the)
        //{
        //    QLTVclassDataContext QLTV = new QLTVclassDataContext();
        //    DocGia d = new DocGia();
        //    d.HoTenDocGia = the.HoTenDocGia1;
        //    d.NgaySinh = the.NgaySinh1;
        //    d.DiaChi = the.DiaChi1;
        //    d.Email = the.Email1;
        //    d.NgayLapThe = the.NgayLapThe1;
        //    d.MaLoaiDocGia = the.MaLoaiDocGia1;
        //    d.MaNV = the.MaNV1;
        //    d.NgayHetHan = the.NgayHetHan1;
        //    QLTV.DocGias.InsertOnSubmit(d);
        //    QLTV.SubmitChanges();

        //}

        public static int LayThang(DocGiaDTO the)
        {
            QLTVclassDataContext db = new QLTVclassDataContext();
            DateTime ngaylapthe = from lapthe in db.DocGias
                                  where lapthe.MaDocGia = '3'
                                  select lapthe.NgayLapThe;

            int thang = ngaylapthe.Month;
            return thang;
        }
     



        
    }
}
